<?php

namespace App\Http\Requests\Pledge;

use Illuminate\Foundation\Http\FormRequest;

class MakePledgeOrderRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, mixed>
     */
    public function rules()
    {
        return [
            "rule_id"       => "required|exists:swt_pledges_rule,id",
            "pledge_num"    => "required|min:100|numeric",
            "pay_password"  => "required",
        ];
    }

    public function messages()
    {
        return [
            "pledge_num.min" => __("validate-message.pledge_num_min"),
            "pay_password.required"  => __("validate-message.password_required"),
        ];
    }
}
